package com.wuda.lucene;

import java.io.Reader;

import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.Tokenizer;

/**
 * lucene分词实现
 * 
 * @author wuda
 * 
 */
public class GTAnalyzer extends Analyzer {

	@Override
	protected TokenStreamComponents createComponents(String fieldName,
			Reader reader) {
		Tokenizer source = new GTSentenceTokenizer(reader);
		TokenStream result = new GTTokenFilter(source);
		TokenStreamComponents components = new TokenStreamComponents(source,
				result);
		return components;
	}

}
